#!/bin/sh

CHECK=false
LINK=false
CLONE=false

. "$TEST_SHELL_PATH/dbops-major-version-upgrade/abstract-major-version-upgrade"

shell_unit_test_dbops_major_version_upgrade_setup() {
  (
  echo "pod/$CLUSTER_NAME-0"
  echo "pod/$CLUSTER_NAME-1"
  ) > "$TEST_TARGET_PATH/cluster_pods"
  echo false > "$TEST_TARGET_PATH/pod_0_restarted"
  echo false > "$TEST_TARGET_PATH/pod_1_restarted"
  echo "pod/$CLUSTER_NAME-1" > "$TEST_TARGET_PATH/primary_pod"
}

shell_unit_test() {
  shell_unit_test_dbops_major_version_upgrade
  check_dbops_result
}

mock kubectl kubectl_mock_overwrite

kubectl_mock_overwrite() {
  mokked
  case "$*" in
    *)
    not_mokked
    ;;
  esac
}
